package some.talk.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import some.member.dao.MemberDao;

@Controller
public class NoListController {
	
	@Autowired
	private MemberDao memberDao;
	
	@RequestMapping("/noListView.do")
	public ModelAndView process(@RequestParam("listview")String listview,HttpSession session){
		
		String id = (String)session.getAttribute("id");
		Map<String,Object> map = new HashMap<String,Object>();
		
		map.put("id", id);
		map.put("show", listview);
		memberDao.updateListview(map);
		
		
		return new ModelAndView("NoList","listview",memberDao.getListView(id));
	}
}
